<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<%--
  Created by IntelliJ IDEA.
  User: 董灌磊
  Date: 2024/5/24
  Time: 10:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>车位租赁协议</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }
        .container {
            width: 80%;
            margin: 0 auto;
        }
        header {
            background-color: #f2f2f2;
            padding: 10px 0;
            text-align: center;
        }
        section {
            margin: 20px 0;
        }
        h1, h2 {
            color: #333;
        }
        p, li {
            color: #666;
            line-height: 1.6;
        }
        table {
            width: 100%;
            border-collapse: collapse;
        }
        table, th, td {
            border: 1px solid #ddd;
        }
        th, td {
            padding: 10px;
            text-align: left;
        }
        th {
            background-color: #f2f2f2;
        }
        footer {
            text-align: center;
            margin-top: 30px;
        }
    </style>
</head>
<body>
<div class="container">
    <header>
        <h1>车位租赁协议</h1>
    </header>
    <section>
        <h2>合同双方信息</h2>
        <table>
            <tr>
                <th>甲方（出租方）</th>
                <td> ${sessionScope.parkingcar.parkinglot.park.parkcode}物业</td>
            </tr>
            <tr>
                <th>乙方（承租方）</th>
                <td>姓名：${sessionScope.parkingcar.owners.ownername} 身份证号：${sessionScope.parkingcar.owners.ownercardno} 联系方式：${sessionScope.parkingcar.owners.ownerphone}</td>
            </tr>
        </table>
    </section>
    <section>
        <h2>车位信息</h2>
        <table>
            <tr>
                <th>车位位置</th>
                <td>${sessionScope.parkingcar.parkinglot.park.parkcode}小区 ${sessionScope.parkingcar.parkinglot.parkingcode}号车位</td>
            </tr>
            <tr>
                <th>租赁期限</th>
                <td>自${sessionScope.starttime}日至${sessionScope.endtime}</td>
            </tr>
        </table>
    </section>
    <section>
        <h2>租金及支付方式</h2>
        <p>租金总额：${sessionScope.parkingcar.price}元/月</p>
    </section>
    <section>
        <h2>权利与义务</h2>
        <p>甲方责任：确保车位适租状态，维护停车场公共设施。</p>
        <p>乙方责任：按时支付租金，合理使用车位，遵守小区管理规定。</p>
    </section>
    <section>
        <h2>违约责任</h2>
        <p>双方应严格遵守合同约定，如有违约，需承担相应责任。</p>
    </section>
    <section>
        <h2>其他约定</h2>
        <p>______</p>
    </section>
    <footer>
        <p>本合同一式两份，甲乙双方各执一份，自双方签字盖章之日起生效。</p>
        <p>甲方签字：________ 乙方签字：________</p>
        <p>签订日期：____年____月____日</p>
    </footer>
</div>
<button class="print-btn" id="printBtn">打印合同</button>
</body>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        $('#printBtn').click(function() {
            window.print();
        });
    });
</script>

</html>